﻿using IdleTest.MSTest;
using IdleTest.EFAndMVCDemo.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IdleTest.EFAndMVCDemo.TestUtilities
{
    public class UserTestHelper
    {
        public string ExistedLoginName = "zhangsan";

        public string ExistedPassword = "123456";

        public string NotExistedLoginName = "zhangsan1";

        public string NotExistedPassword = "123";

        public UserModel ExistedUser
        {
            get { return new UserModel { LoginName = ExistedLoginName, Password = ExistedPassword }; }
        }

        public UserModel NotExistedUser
        {
            get { 
                return new UserModel { 
                    LoginName = NotExistedLoginName, Password = NotExistedPassword, Age = 30 }; 
            }
        }

        public void AssertEqual(UserModel expected, UserModel actual)
        {
            AssertCommon.IsNull(false, expected);
            AssertCommon.IsNull(false, actual);

            AssertCommon.AreEqual<string>(expected.LoginName, actual.LoginName);
            AssertCommon.AreEqual<string>(expected.Password, actual.Password);
            AssertCommon.AreEqual<int>(expected.Age, actual.Age);
        }

    }
}
